<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js"></script>

</head>
<body>
  <div id="app">
    <div>
      <div v-for="item in arr" :key="item" style="display: inline-block;">
        <!-- 1. 每个复选框都得用 value 保存对应的频道名字, 一会被选中可以自动把 value 值装到 v-model 变量中 -->
        <input type="checkbox" v-model="checkArr" :value="item"/>
        <span>{{ item }}</span>
      </div>
      <ul>
        <!-- 2. 把收集到的数组渲染到li上显示 -->
        <li v-for="item in checkArr" :key="item"> {{ item }} </li>
      </ul>
    </div>
  </div>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        arr: ["科幻", "喜剧", "动漫", "冒险", "科技", "军事", "娱乐", "奇闻"],
        checkArr: [] // 收集选中的复选框的value值
      }
    })
  </script>
</body>
</html>